import {createRouter, createWebHashHistory} from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'Index',
        component: () => import('@components/index/Index.vue'),
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('@components/user/Login.vue'),
    },
    {
        path: '/register',
        name: 'Register',
        component: () => import('@components/user/Register.vue'),
    },
    {
        path: '/detail/:id',
        name: 'Detail',
        component: () => import('@components/book/Detail.vue'),
        props: true
    },
    {
        path: '/categories',
        name: 'Categories',
        component: () => import('@components/book/Categories.vue'),
    },
    {
        path: '/content/:id/:bid/:name/:catalog',
        name: 'Content',
        component: () => import('@components/book/Content.vue'),
        props: true
    },
    {
        path: '/center',
        name: 'UCenter',
        component: () => import('@components/user/UCenter.vue'),
    },
    {
        path: '/search',
        name: 'Search',
        component: () => import('@components/search/Search.vue'),
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})


export default router
